<?php if(isset($user)) $user = $user->result_array(); ?>
	<div class="row-fluid sortable">
				<div class="box span12">
					<div class="box-header well" data-original-title>
						<h2 id="action-title"><?php if(isset($NEW)) echo "Tambah User"; else echo "Edit User"; ?></h2>
					</div>
					<div class="box-content">
						<table class="table">
							<col width="10%">
							<col width="40%">
							  <tbody>
								<tr>
									<td>Nama User</td>
									<td><input id="nama_user" name="nama_user" value="<?php if(isset($user)) echo $user[0]['NAMA']; ?>" type="text"></td>          
								</tr>
								<tr>
									<td>Username</td>
									<td><input id="username" name="username" value="<?php if(isset($user)) echo $user[0]['USERNAME']; ?>" type="text"></td>          
								</tr>
								<tr>
									<td>Password</td>
									<td><input type="password" id="password" name="password" value="<?php if(isset($user)) echo $user[0]['PASSWORD']; ?>" type="text"></td>          
								</tr>
								<tr>
									<td>Email</td>
									<td><input id="email" name="email" value="<?php if(isset($user)) echo $user[0]['EMAIL']; ?>" type="text"></td>          
								</tr>
								<tr>
									<td>Role</td>
									<td>
										<select id="role" name="role">
											<option></option>
											  <?php foreach($all_role->result_array() as $row): ?>
													<option <?php if(isset($user)) if($user[0]['ID_ROLE'] == $row['ID_ROLE']) echo "selected='selected'"; ?> value="<?= $row['ID_ROLE']; ?>"><?= $row['NAMA_ROLE']; ?></option>
												<?php endforeach; ?>
										</select>
									</td>   											
								</tr>
								<tr>
									<td><input type="hidden" name="id_user" value="<?php if(isset($user)) echo $user[0]['ID_USER']; ?>"></td>
									<td id="button_panel">
										<button class="btn" onclick="addUser();">Simpan</button>
									</td>
								</tr>
								                             
							  </tbody>
						 </table>      
					</div>
				</div><!--/span-->
			<div><!--/row-->